<layout name="layout" />

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		
		<table border="" cellspacing="" cellpadding="">
			<tr>
				<th>ID</th>
				<th>CNAME</th>
				<th>子类</th>
				<!--<th>INFO</th>-->
				<th>PID</th>
				<th>PATH</th>
				<th>操作</th>
			</tr>
			<volist name="data" id="row">
			<tr>
				<td>{$row[id]}</td>
				<?php
				$arr = explode(',',$row['path']);
				//echo "<pre>";
				//print_r($arr);
				//echo "</pre>";
				array_pop($arr);
				$size=count($arr);
				?>
				<td>{:str_repeat('|-',$size-1)}{$row[cname]}</td>
				<if condition="$size eq 3">
					<td>不能再添加了</td>
				<else />
					<td><a href="{:U('add',array('pid'=>$row[id],'path'=>$row[path].$row[id].','))}">添加</a></td>
				</if>
				<!--<td>{$row[info]}</td>-->
				<td>{$row[pid]}</td>
				<td>{$row[path]}</td>
				<td>
					<a href="{:U('edit')}">编辑</a>
					<a href="{:U('edit')}">删除</a>
				</td>
			</tr>	
			</volist>
			
		</table>
		{$total}
		<nav>
			{$page}
		</nav>
	</body>
</html>
